-- GENERATED SPELL FOR [Twilight Emissary] --


function spell0_8913(pUnit, Event) --@Arcane Bolt,n/a--
pUnit:FullCastSpellOnTarget(13748,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8913', 1000, 1)
end

function spell1_8913(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(13745,pUnit)
pUnit:RegisterEvent('Sorts_8913', 1500, 1)
end

function spell2_8913(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(12466,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8913', 3000, 1)
end

function spell3_8913(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_8913', 0, 1)
end

function spell4_8913(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15063,pUnit)
pUnit:RegisterEvent('Sorts_8913', 8307, 1)
end

function spell5_8913(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(15043,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8913', 7000, 1)
end

function spell6_8913(pUnit, Event) --@Fury of Ragnaros,n/a--
pUnit:FullCastSpellOnTarget(15288,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8913', 546, 1)
end

function Sorts_8913(pUnit, Event)
local choix_sorts_8913 = math.random(0, 6)
if choix_sorts_8913 == 0 then
pUnit:RegisterEvent('spell0_8913', 1, 1)
end
if choix_sorts_8913 == 1 then
pUnit:RegisterEvent('spell1_8913', 1, 1)
end
if choix_sorts_8913 == 2 then
pUnit:RegisterEvent('spell2_8913', 1, 1)
end
if choix_sorts_8913 == 3 then
pUnit:RegisterEvent('spell3_8913', 1, 1)
end
if choix_sorts_8913 == 4 then
pUnit:RegisterEvent('spell4_8913', 1, 1)
end
if choix_sorts_8913 == 5 then
pUnit:RegisterEvent('spell5_8913', 1, 1)
end
if choix_sorts_8913 == 6 then
pUnit:RegisterEvent('spell6_8913', 1, 1)
end
end

function mob8913_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_8913', math.random(1500, 3000), 1)
end

function mob8913_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8913_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8913_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(8913, 1, 'mob8913_Action')
RegisterUnitEvent(8913, 2, 'mob8913_Leave')
RegisterUnitEvent(8913, 3, 'mob8913_Kill')
RegisterUnitEvent(8913, 4, 'mob8913_Die')
